﻿using System;
using System.Collections;

namespace MyPC
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 不好哇，别看哇
            Configuration configuration = new Configuration();
            Console.WriteLine("欢迎使用老黄牌电脑");
            Console.WriteLine("请输入开机用户名称：");
            Console.WriteLine("请输入开机用户密码；");
            ArrayList arrayList = configuration.User();
            ArrayList array = configuration.Password();
            bool mistake = true;
            int kill = 0;
            while (mistake == true)
            {
                object user = Console.ReadLine();
                object password = Console.ReadLine();

                int userIdx = arrayList.IndexOf(user);
                int passwordIdx = array.IndexOf(password);
                if (userIdx == passwordIdx && userIdx >= 0 && passwordIdx >= 0)
                {
                    Console.WriteLine("叮咚~ 开机咯~");
                    mistake = false;
                }
                if (mistake == true)
                {
                    Console.WriteLine("用户名称或密码错误！！！");
                    Console.WriteLine("请再次输入；");
                    kill += 1;
                }
                if (kill == 5)
                {
                    break;
                }
            }
            if (kill == 5)
            {
                Console.WriteLine("登录错误次数过多，正在格式化电脑......");
            }
        }
        #endregion
    }
}
